Itential Automation Gateway

On this page:

User Decorations

Automation Gateway aggregates all of your Ansible modules, roles, playbooks, and scripts. Along with this attribute is the ability to decorate or enhance each module, role, playbook, and script. With decoration, users have the flexibility to edit JSON schemas for identifying and modifying metadata such as input parameters, descriptions, or types. Decoration is currently stored in the database.

As of release 2019.3, users now have the ability to export/import/remove the schemas through a set of APIs.

Export

Description: Retrieve the schema from a module, role, playbook, or script. The response from this call can be saved and used as direct input for importing a schema to another Automation Gateway server.

API:

GET hostname:port/modules/{module_name}/schema
GET hostname:port/roles/{role_name}/schema
GET hostname:port/playbooks/{playbook_name}/schema
GET hostname:port/scripts/{script_name}/schema

Sample Response

```json
{
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook",
        "type": "object"
    }
}
```

Import

Description: Add/update the schema for a module, role, playbook, or script.

API:

PUT hostname:port/modules/{module_name}/schema
PUT hostname:port/roles/{role_name}/schema
PUT hostname:port/playbooks/{playbook_name}/schema
PUT hostname:port/scripts/{script_name}/schema

Sample Request

```json
{
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on a network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook_1",
        "type": "object"
    }
}
```

Sample Response

```json
{
    "type": "playbook",
    "name": "sample_playbook_1",
    "schema": {
        "properties": {
            "command": {
                "type": "string",
                "description": "CLI command to execute on a network device"
            }
        },
        "required": [
            "command"
        ],
        "title": "sample_playbook_1",
        "type": "object"
    }
}
```

Removal

Description: Delete the user decorated schema for a module, role, playbook, or script.

Note: This call will only remove a user decorated schema. It does not apply to the certified schemas provided by Itential for roles and modules. It also does not apply to a module's native schema that is automatically created at discovery time by the AG server.

API:

DELETE hostname:port/modules/{module_name}/schema
DELETE hostname:port/roles/{role_name}/schema
DELETE hostname:port/playbooks/{playbook_name}/schema
DELETE hostname:port/scripts/{script_name}/schema

Sample Response

```json
{
    "code": 200,
    "message": "deleted"
}
```